import threading
import threading as th
import random
import time


def outer(func):
    def inner(*args, **kwargs):
        print("start the {0:*^20}".format(func.__name__))
        res=func(*args, **kwargs)
        print("end the {0:*^20}".format(func.__name__))
        return res
    return inner
@outer
def func1():
    print("hello world")
@outer
def func2():
    print("hello python")
pool=[func1,func2]
threads=[]
for item in range(10):
    th1=threading.Thread(target=random.choice(pool))
    threads.append(th1)
    time.sleep(4)
    th1.start()
for item in threads:
    item.join()